package com.example.blog.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/*自定义业务异常  可能出现异常的业务中使用
*   使用方式  try的方式  或其他方式使用
*
**/
@EqualsAndHashCode(callSuper = true)
@Data
public class BusinessException extends RuntimeException{
    private Integer code;
    private String args;
    private Exception exception;


    public BusinessException(Integer code, String message) {
        super(message);
        this.code=code;
    }
    public BusinessException(Integer code, String message,String args, Throwable cause) {
        super(message,cause);
        this.code=code;
        this.args=args;
    }

    public BusinessException(Integer code, String args, Exception exception) {
        this.code=code;
        this.args=args;
        this.exception=exception;
    }
}
